<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="edu.tms.controller.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>班级信息</title>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <link rel="stylesheet" type="text/css" href="<%=path %>/css/f/default.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/navs.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/assignment.css"/>
	<script src="js/jquery.min.js"></script>
	<script src="js/f/default.js"></script>
  </head>
  
  <body>
  	<div class="all">
  		<jsp:include page="/nav.jsp"></jsp:include>
  		<div class="rightall float-left" id="seeclass">
  			<div class="already">
  				<div class="already-title">
  					<div class="left">班级信息</div>
  				</div>
	                <div style="margin-top: 15px;">
	                	<span style=" margin-left:31%;"></span>
	                	班级:<select class="task" name="class">
	                		<c:forEach var="clas" items="${classinfo}">
	                        <option value="${clas.className }">${clas.className }</option>
	                       
	                        </c:forEach>
	                    </select>
	                	<span style=" margin-left:50px;"></span>
	                	<button id="btn1" class="task btn-style" >查找</button>
	                </div>
	            <div id="div1">
	            <table>
	            	<tr class="tr-style-head">
	            		<td>班级编号</td>
	            		<td>班级名称</td>
	            		<td>专业</td>
	            		<td>辅导员</td>
	            		<td>班级人数</td>
	            		<td>状态</td>
	            		<td>操作</td>
	            	</tr>
	            	<c:forEach var="clas" items="${classinfo }">
	            	<tr class="tr-style">
	            		<td>${clas.classId }</td>
	            		<td>${clas.className }</td>
	            		<td>${clas.majorName }</td>
	            		<td>${clas.classTchId }</td>
	            		<td>${clas.classSize }</td>
	            		<c:if test="${clas.classState==1 }">
	            			<td>正常</td>
	            		</c:if>
	            		<c:if test="${clas.classState==2 }">
	            			<td>冻结</td>
	            		</c:if>
	            		
	            		<td>
	            			<a class="a-color-red" onclick="student(this)" title="${clas.className }">查看班级人员</a>/
	            			<a class="a-color-red" onclick="team(this)" title="${clas.className }">查看小组</a>
	            		</td>				 <!-- href="Student/findTeamByClassName.do?classId=1" -->
	            	</tr>
	            	</c:forEach>
	            	
	            </table>
	            </div>
	            <c:if test="${pages > 1 }">
               		<div class="previous">
	               		<c:if test="${pageNo>1}">
	                    	<a href="teacher/releaseWork.do?pageNo=${pageNo-1}">上一页</a>
	                	</c:if>
	                   	<c:forEach var="p" begin="1" end="${pages }" step="1">
	                   		<c:if test="${p==pageNo }">
	                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
	                   		</c:if>
	                   		<c:if test="${p!=pageNo }">
	                   			<a href="teacher/releaseWork.do?pageNo=${p }" >&nbsp;${p}&nbsp;</a>
	                   		</c:if>
	                   	</c:forEach>
	                    <c:if test="${pageNo<pages}">
	                    	<a href="teacher/releaseWork.do?pageNo=${pageNo+1}">下一页</a>
	                	</c:if>
                   </div>
                </c:if>

               <!-- <div class="float-right excel"><button name="" class="btn-style">导出文件</button></div> --> 
            </div>
  		</div>
  		<div class="rightall float-left" id="stu">
  		     <div class="already">
  				<div class="already-title">
  					<div class="left">学生信息</div>
  					<div class="left float-right">
  						<a class="a-color-write" onclick="seeClass()" href="teacher/ClassInfo.do?tchId=4">返回班级信息</a>&nbsp;&nbsp;&nbsp;&nbsp;
  						<a class="a-color-write" onclick="team(this)" title="">返回班级小组</a>
  					</div>
  				</div>
	  			<!-- action="Teacher/findStuMsgByClassId.do" -->
	                <div style="margin-top: 15px;">
	                	<span style=" margin-left:20%;"></span>
	                	学号:<input type="text" name="stuId" value="" class="task"/>
	                	<span style=" margin-left:50px;"></span>
	                	姓名:<input type="text" name="stuNamee" value="" class="task"/>
	                	<span style=" margin-left:50px;"></span>
	                	<button class="task btn-style" id="btn2" onclick="">查找</button>
	                </div>
	            
	            <div id="div2">
	            <table>
	            	<tr class="tr-style-head">
	            		<td>专科学号</td>
	            		<td>本科学号</td>
	            		<td>姓名</td>
	            		<td>性别</td>
	            		<td>班级</td>
	            		<td>小组</td>
	            		<td>电话</td>
	            		<td>状态</td>
	            	</tr>
	            	
	            	<tr class="tr-style">
	            		<td>1</td>
	            		<td>1</td>
	            		<td>张三</td>
	            		<td>男</td>
	            		<td>软件(1)班</td>
	            		<td>1</td>
	            		<td>11221212311</td>
	            		<td>正常</td>
	            	</tr>
	            	<tr class="tr-style">
	            		<td>1</td>
	            		<td>1</td>
	            		<td>张三</td>
	            		<td>男</td>
	            		<td>软件(1)班</td>
	            		<td>1</td>
	            		<td>11221212311</td>
	            		<td>正常</td>
	            	</tr>
	            </table>
	            </div>
	            
                	
                    <div class="float-right excel"><button name="" class="btn-style">导出文件</button></div>
                </div>
            </div>
        
  		<div class="rightall float-left" id="group">
  		     <div class="already">
  				<div class="already-title">
  					<div class="left">软件(1)班小组信息</div>
  					<div class="left float-right">
  						<span style="cursor: pointer;float:right;margin-right:20px;" onclick="seeClass()">返回班级信息</span>
  					</div>
  				</div>
	  			
	                <div style="margin-top: 15px;">
	                	<span style=" margin-left:20%;"></span>
	                	组名:<input type="text" name="group"  class="task"/>
	                	<span style=" margin-left:50px;"></span>
	                	姓名:<input type="text" name="stuName"  class="task"/>
	                	<span style=" margin-left:50px;"></span>
	                	<button class="task btn-style" onclick="team(this)" title="gg">查找</button>
	                </div>
	            
	            <div id="div3">
	            <table>
	            	<tr class="tr-style-head">
	            		<td>班级名称</td>
	            		<td>小组名称</td>
	            		<td>组长姓名</td>
	            		<td>小组人数</td>
	            		<td>小组状态</td>
	            		<td>操作</td>
	            	</tr>
	            	
	            	<tr class="tr-style">
	            		<td>软件(1)班</td>
	            		<td>1</td>
	            		<td>张三</td>
	            		<td>6</td>
	            		<td>正常</td>
	            		<td>
	            			<a class="a-color-red" onclick="seeGroupStu()">查看小组成员</a>
	            		</td>
	            	</tr>
	            	<tr class="tr-style">
	            		<td>软件(1)班</td>
	            		<td>1</td>
	            		<td>张三</td>
	            		<td>6</td>
	            		<td>正常</td>
	            		<td>
	            			<a class="a-color-red" onclick="seeGroupStu()">查看小组成员</a>
	            		</td>
	            	</tr>
	            </table>
	            </div>
	            <div class="previous">
                	
                    <div class="float-right excel"><button name="" class="btn-style">导出文件</button></div>
                </div>
            </div>
        </div>
  	</div>
  	<script type="text/javascript">
  		//查看班级成员
  		function seeStu(){ 
			var popUp = document.getElementById("stu"); 
			popUp.style.display = "block"; 
			var seeclass=document.getElementById("seeclass");
			seeclass.style.display = "none";
		}
		//返回班级列表
		function seeClass(){ 
			var popUp = document.getElementById("stu"); 
			popUp.style.display = "none";
			var group = document.getElementById("group"); 
			group.style.display = "none";
			var seeClass=document.getElementById("seeclass");
			seeClass.style.display = "block";
		}
		//查看班级小组
		function seeGroup(){
			var popUp = document.getElementById("group"); 
			popUp.style.display = "block";  
			var seeClass=document.getElementById("seeclass");
			seeClass.style.display = "none";
			var group = document.getElementById("stu"); 
			group.style.display = "none";
		}
		//查看小组成员
		function seeGroupStu(){
			var popUp = document.getElementById("stu"); 
			popUp.style.display = "block";  
			var seeGroup=document.getElementById("group");
			seeGroup.style.display = "none";
		}
		//返回班级小组
		function returnGroup(){
			var group = document.getElementById("stu"); 
			group.style.display = "none";
			var seeClass=document.getElementById("group");
			seeClass.style.display = "block";
		}
	$(function(){
  		console.log("OK");
  		$("#btn1").click(function(){
  			var v=$("select").val();
  			console.log("sadd");
  		});
  		$("#btn2").click(function(){
  			seeStu();
  			var stuid=$("input[name='stuId']").val();
  			var stuname=$("input[name='stuNamee']").val();
  			console.log(stuid+"sdsd"+stuname);
  			if(stuid.length==0&&stuname.length==0){
  				$("#div2").load("teacher/findStuMsgByClassId.do?classNameteamId="+className+"&pageNo="+PageNo);
  				console.log(className+"sdzxccxsd"+PageNo);
  			}else{
  			$("#div2").load("teacher/findStuMsgByClassId.do?stuId="+stuid+"&stuNamee="+stuname);
  			}
  		});
  		
  	});
  	var className;
  	var PageNo=1;
  	function student(t){
  		$(function(){
  			seeGroupStu();
  			seeStu();
  			$("#div2").load("teacher/findStuMsgByClassId.do?classNameteamId="+t.title);
  			className=t.title;
  		});
  	}
  	function studentByPage(pageNo){
  		$(function(){
  			seeGroupStu();
  			seeStu();
  			$("#div2").load("teacher/findStuMsgByClassId.do?classNameteamId="+className+"&pageNo="+pageNo);
  			PageNo=pageNo;
  		});
  	}
  	function student2(t){
  		$(function(){
  			seeGroupStu();
  			seeStu();
  			$("#div2").load("teacher/findStuMsgByClassId.do?teamId="+t.title);
  			
  		});
  	}
  	var s;
  	function team(t){
  	
  		$(function(){
  			var stuName=$("input[name='stuName']").val();
  			var squadName=$("input[name='group']").val();
  			if(t.title!=""){
  				s=t.title;
  				
  			}
  			seeGroup();
  			$("#div3").load("teacher/findTeamByTeam.do?className="+s+"&stuName="+stuName+"&squadName="+squadName);
  		});
  	}	
  		
  		
  	
  	function classinfo(){
  		seeClass();
  		$(function(){
  			
  		});
  	}
 </script>
  </body>
</html>
